const express = require('express')
const app = express()
const secret = require('./util/config')

app.use(require('cors')())
app.use(express.json())
app.use('/uploads', express.static(__dirname + '/uploads'))

app.set('secret', secret.TOKENSECRET)

require('./routes/admin')(app)
require('./routes/app')(app)
require('./plugins/db')(app)

app.listen(3000, () => {
    console.log('http://localhost:3000')
})